package com.sun.study.patterns.template;

public class TestManage {
    
    private OperatorTemplate<OperatorResult> operatorTemplate = new OperatorTemplate<OperatorResult>();

    public OperatorResult test() {
        OperatorResult operatorResult = null;
        operatorResult = operatorTemplate.doOperator(new OperatorCallback<OperatorResult>() {
            public OperatorResult doOperator() {
                return getOperatorResult();
            }
        });

        return operatorResult;
    }
    
    public OperatorResult getOperatorResult() {
        OperatorResult operatorResult = new OperatorResult();
        operatorResult.setResult(false);
        operatorResult.setMessage("This is test");
        return operatorResult;
    }
    
    public static void main(String[] args) {
        TestManage testManage = new TestManage();
        OperatorResult result = testManage.test();
        System.out.println(result.getMessage());
        
    }
}
